/**
 * 图片预览的modal
 * @author: minzhang
 * @update: 2016-10-13
 */

import React, { PropTypes } from 'react';
import { Modal } from 'antd';
import styles from './CommonPreviewModal.less';

const CommonPreviewModal = ({
  previewVisible,
	previewImage,
	previewImageName,
	onPreviewCancel,
}) => {
	
	const props = {
		visible: previewVisible,
		closable: false,
		footer: null,
		onCancel: onPreviewCancel,
		wrapClassName: 'vertical-center-modal',
	}
	
  return (
    <Modal {...props} className="preview-modal">
			<img alt={previewImageName} src={previewImage} style={{width: '100%'}} />
		</Modal>
  );
};

CommonPreviewModal.propTypes = {
	previewVisible: PropTypes.any,
	previewImage: PropTypes.any,
	previewImageName: PropTypes.any,
  handleCancel: PropTypes.func,
};

export default CommonPreviewModal;